import whiteList from "./whiteList.js";
import { h } from "vue";
import { PieChartOutlined, AppstoreOutlined } from "@ant-design/icons-vue";

const routes = [
  {
    path: "/",
    redirect: "/user",
  },
  {
    path: "/",
    name: "",
    component: () => import("@/layout/index.vue"),
    children: [
      {
        path: "/user",
        name: "user",
        index: "4",
        title: "用户管理",
        icon: h(AppstoreOutlined),
        component: () => import("@/views/user/userIndex.vue"),
      },
      {
        path: "/log",
        name: "log",
        index: "5",
        icon: h(PieChartOutlined),
        title: "日志管理",
        children: [
          {
            path: "/log/add",
            name: "addUser",
            title: "历史日志",
            component: () => import("@/views/log/logIndex.vue"),
          },
          {
            path: "/log/edit",
            name: "editUser",
            title: "最新日志",
            component: () => import("@/views/log/operationLog.vue"),
          },
        ],
      },
    ],
  },
  ...whiteList,

  { path: "/:pathMatch(.*)*", redirect: "/NoPermissin" },
];

export default routes;
